import './App.css';
import React, { Component, lazy, Suspense } from 'react';
import { BrowserRouter as Router, Route, Redirect } from 'react-router-dom'
import { Provider } from 'react-redux';
import store from './store/index';
// import Aersonage from './views/Aersonage'
// import Ahopping from './views/Ahopping'
// import Alassify from './views/Alassify'
// import Aomplete from './views/Aomplete'
// import Astore from './views/Astore'
import Aarticulars from './views/Aarticulars';

var Aersonage = lazy(() => import("./views/Aersonage"))
var Ahopping = lazy(() => import("./views/Ahopping"))
var Aomplete = lazy(() => import("./views/Aomplete"))
var Alassify = lazy(() => import("./views/Alassify"))
var Astore = lazy(() => import("./views/Astore"))
var Collect = lazy(() => import("./views/Collect"))
var Registers = lazy(() => import("./views/Registers"))
//var Aarticulars = lazy(() => import("./views/Aarticulars"))

class App extends Component {
  constructor(props) {
    super(props);
    this.state = {
      bottomdata: []
    }
  }
  render() {
    return (
      <div>
        <Provider store={store}>
          <Router>
            <Suspense fallback={<div>组件加载中...</div>}>
              <Route path="/ahopping" component={Ahopping}></Route>
            </Suspense>
            <Suspense fallback={<div>组件加载中...</div>}>
              <Route path="/alassify" exact component={Alassify}></Route>
            </Suspense>
            <Suspense fallback={<div>组件加载中...</div>}>
              <Route path="/astore" exact component={Astore}></Route>
            </Suspense>
            <Suspense fallback={<div>组件加载中...</div>}>
              <Route path="/aomplete" exact component={Aomplete}></Route>
            </Suspense>
            {/* <Suspense fallback={<div>组件加载中...</div>}>
            <Route path="/aarticulars" exact component={Aarticulars}></Route>
          </Suspense> */}
            <Suspense fallback={<div>组件加载中...</div>}>
              <Route path="/aersonage" exact component={Aersonage}></Route>
            </Suspense>
            <Suspense fallback={<div>组件加载中...</div>}>
              <Route path="/Collect" exact component={Collect}></Route>
            </Suspense>
            {/* <Route path="/ahopping" exact component={ Ahopping }></Route>
          <Route path="/alassify" exact component={ Alassify }></Route>
          <Route path="/astore" exact component={ Astore }></Route>
          <Route path="/aomplete" exact component={ Aomplete }></Route>
          <Route path="/aersonage" exact component={ Aersonage }></Route>*/}
            <Route path="/registers" exact component={Registers}></Route>
            <Route path="/aarticulars" exact component={Aarticulars}></Route>
            <Redirect from="/" to="/astore"></Redirect>
          </Router>
        </Provider>
      </div>
    );
  }
}

export default App;